<?php
/*************************************************

推送数据公共控制器 - the 
Author: WangHuabin <17-5-27>

*************************************************/
namespace Home\Controller;
use Think\Controller;
class PushController extends Controller {

    public function get_push($tag){

        //获取推送位置
         $map['tag'] = $tag;
         $push = D('Push')->get_one($map);
         $type = $push['type'];
         // return $type;
        //查询推送数据
         $map = array();
         if($type==0){
            $map['id'] = array('in',$push['cid']);
            $field = "id,title,house_id,author_id,source_id,pic,content_short,add_time,sort";
            $order = 'sort desc';
            $data = D('News')->get_all($map,$field,$order);
         
         }else{
            // echo 1;die;
            $map['id'] = array('in',$push['cid']);
            $field = "*";
            $order = 'sort desc';
            $data = D('Video')->get_all($map,$field,$order);
         }
        // print_r($data);die;
         return $data;
    }

}